﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Practicalities.aspx.vb" Inherits="MyProject.WebForm7" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
     <br />
    Select a Country:<br />
    <asp:DropDownList ID="DD_Country" runat="server" AutoPostBack="True" 
        DataSourceID="AccessDataSource2" DataTextField="Country" 
        DataValueField="Country">
    </asp:DropDownList>
    <asp:AccessDataSource ID="AccessDataSource2" runat="server" 
        DataFile="~/App_Data/AssignmentDB.accdb" 
        SelectCommand="SELECT [Country] FROM [Country] ORDER BY [Country]">
    </asp:AccessDataSource>
    <br />
    <br />
    <br />
     <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="AccessDataSource1" AllowPaging="True" AllowSorting="True">
        <Columns>
            <asp:BoundField DataField="ItemName" HeaderText="Title" 
                SortExpression="ItemName" />
            <asp:ImageField AccessibleHeaderText="Picture" DataImageUrlField="File">
                <ControlStyle CssClass=".image" Height="150px" Width="150px" />
                <ItemStyle CssClass=".image" Height="150px" Width="150px" />
            </asp:ImageField>
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                    DataNavigateUrlFormatString="photodetail.aspx?ID={0}" Text="Detail" />
                    </Columns>
    </asp:GridView>
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
        DataFile="~/App_Data/AssignmentDB.accdb" 
        
        SelectCommand="SELECT [ID],
         [ItemName], [Description], [File] FROM [Item] WHERE (([Category] = ?) AND ([Country] = ?))">
        <SelectParameters>
            <asp:Parameter DefaultValue="Practicalities and Travel Tips" Name="Category" 
                Type="String" />
            <asp:ControlParameter ControlID="DD_Country" Name="Country" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:AccessDataSource>
    <p>
    </p>
</asp:Content>
